package com.wsjc.web.controller.hospital;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.wsjc.common.core.page.PageBean;
import com.wsjc.common.core.page.PageParam;
import com.wsjc.manager.service.routine.hospital.WjHospitalService;

@RestController
@RequestMapping(value = "/boss/hospital/")
public class WjHospitalController {

	private Logger logger = LoggerFactory.getLogger(WjHospitalController.class);
	
	@Autowired
	public WjHospitalService wjHospiatalService ;

	/**
	 * 检索医院
	 * @param hospitalName
	 * @return
	 */
	@RequestMapping(value = "search", method = RequestMethod.GET)
	public String search(String hospitalName, PageParam pageParam, Model model) {
		
		try {
			
			PageBean pageBean = wjHospiatalService.listHospitalPage(pageParam, hospitalName);
			
			model.addAttribute("pageBean", pageBean);
			model.addAttribute("countResultMap", pageBean.getCountResultMap());
			model.addAttribute("pageParam", pageParam);
			model.addAttribute("pageParam", pageParam);
			// 检索条件
			model.addAttribute("hospitalName", hospitalName);
			
    		return "页面地址" ;
		} catch (Exception e) {
			logger.error("boos-hospital|search find error ....", e);
			return "页面地址" ;
		}
	}


	
	
	
	
	

}
